<?php
namespace App\Pull;

class Swoole extends Base
{

    /**
     * Notes: 发起websocket请求
     * User: aniu
     * Date: 2020/6/15
     * Time: 10:31
     * @param $data
     * @return mixed
     */
    public function swooleWebsocket($data)
    {
        $url = 'http://' . env('SWOOLE_HOST') . ':' . env('SWOOLE_PORT');
        $params['data'] = $data;
        $res = $this->call('post', $url, $params);
        return $res[1];
    }
}
